package org.aiforum.frountend.service;

import java.util.List;

import javax.transaction.Transactional;
import javax.transaction.Transactional.TxType;

import org.aiforum.domain.Plate;
import org.aiforum.frountend.common.Response;
import org.aiforum.frountend.dao.PlateDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 板块业务实现
 * @author VIC
 *
 */
@Service("plateService")
@Transactional(value=TxType.REQUIRED)
public class PlateServiceImpl implements PlateService {
	
	@Autowired
	private PlateDao plateDao;

	@Override
	public Response queryEnablePlate(int state) {
		
		Response response = new Response();
		List<Plate> plates = plateDao.queryPlateByState(state);
		boolean result = null != plates && plates.size() > 0;
		if(result){
			response.setState(result);
			response.setData(plates);
		}else{
			response.setMessage("not result.");
		}
		return response;
	}

}
